package com.github.tetrisgame.model;

public class BlockShape {
    public static final int[][] SHAPE_I = {
            {0,1,0},
            {0,1,0},
            {0,1,0}
    };

    public static final int[][] SHAPE_J = {
            {0,1,0},
            {0,1,0},
            {1,1,0}
    };

    public static final int[][] SHAPE_L = {
            {0,1,0},
            {0,1,0},
            {0,1,1}
    };

    public static final int[][] SHAPE_T = {
            {0,1,0},
            {1,1,1},
            {0,0,0}
    };

    public static final int[][] SHAPE_S = {
            {0,1,1},
            {1,1,0},
            {0,0,0}
    };

    public static final int[][] SHAPE_Z = {
            {1,1,0},
            {0,1,1},
            {0,0,0}
    };

    public static final int[][] SHAPE_O = {
            {1,1},
            {1,1}
    };

    //SHAPE_O.length  几行
    //SHAPE_O[0].length 几列

    public static int[][] getShape(Block.BlockType type){
        switch (type){
            case I: return SHAPE_I;
            case J: return SHAPE_J;
            case L: return SHAPE_L;
            case T: return SHAPE_T;
            case S: return SHAPE_S;
            case Z: return SHAPE_Z;
            default:return SHAPE_O;
        }
    }
}











